package com.ksl.kinglockguard.network;

import java.util.ArrayList;

public class ConnectChangeListener {

	private static ConnectChangeListener changeListener;
	private ConnectChangeListener(){
		
	}
	
	public static ConnectChangeListener getInstance(){
		if(changeListener == null){
			changeListener = new ConnectChangeListener();
		} 
		return changeListener;
	}
	
	private static ArrayList<ConnectChangeListenerInterface> listeners = new ArrayList<ConnectChangeListener.ConnectChangeListenerInterface>();
	
	public void setListener(ConnectChangeListenerInterface listener){
		listeners.add(listener);
	}

	public ArrayList<ConnectChangeListenerInterface> getListeners(){
		return listeners;
	}
	
	public void remove(ConnectChangeListenerInterface l){
		listeners.remove(l);
	}

	public interface  ConnectChangeListenerInterface {
		void onConnectChange();
	}
}
